package com.aaa.power.controller;

import com.aaa.power.entity.UserRole;
import com.aaa.power.service.UserRoleService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 用户和角色关联表(UserRole)表控制层
 *
 * @author makejava
 * @since 2020-11-28 14:49:26
 */
@RestController
@RequestMapping("userRole")
public class UserRoleController {
    /**
     * 服务对象
     */
    @Resource
    private UserRoleService userRoleService;

    /**
     * 通过ID查询单条数据
     *
     * @param userId 主键
     * @return 实例对象
     */
    @GetMapping("queryById")
    public UserRole queryById(Integer userId) {
        return this.userRoleService.queryById(userId);
    }
    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public UserRole selectOne(Integer id) {
        return this.userRoleService.queryById(id);
    }

}